# -*- coding:utf-8 -*-

'''
PROJECT_NAME : auth_demo
file    : forms
author  : 1032162439@qq.com
date    : 2022-09-07 20:26
IDE     : PyCharm
'''
from django import forms
from . import models


class UserInfoModelForm(forms.ModelForm):
    class Meta:
        model = models.UserInfo
        # fields = '__all__'
        exclude = ['token']

    def clean_name(self):

        value = self.cleaned_data['name']
        if value != 123:
            raise forms.ValidationError('名字有误')
        return value

    def clean_password(self):
        pwd = self.cleaned_data['password']


        return pwd


